function VehicleController($scope, $http, $routeParams, PaginationService) {

    // bindable list of vehicles
    $scope.vehicles = [];
    $scope.template;
    $scope.pagination; 

    $scope.initPagination = function() {
	$scope.pagination = PaginationService.initData('vehicle', 'list', '',
	'registerNumber');
	return $scope.pagination;
    };

    // load all todos, copying to the "todos" list on success
    $scope.loadVehicles = function() {
	$http
		.jsonp(
			'http://localhost:8090/CarManagement/vehicle/list?callback=JSON_CALLBACK')
		.success(function(data) {
		    $scope.vehicles = data;
		}).error(function(data, status, headers, config) {
		    $scope.vehicles = [ "Echec !", status, headers, config ];
		});
    };

    $scope.getPagination = function() {
	return $scope.pagination.pagination;
    };

    $scope.setTemplate = function(id) {
	$routeParams.id = id;
	$scope.template = {
	    name : 'fullTank.html',
	    url : 'appli/view/fullTank.html?id=' + id
	};
    };
    
    // when we first start up, load vehicles
    $scope.loadVehicles();
    $scope.initPagination();
}